<?php 
	//timer pengecekan load page...
	include("timer.php");
	$_start_timer = get_microtime();
	 
	//check protect1 jika session da tidak valid, balikin ke index.php
	//jika valid y biarin saja
	
	require_once("protect1.php");
	require_once("connect.php");
	require_once("settings.php");
	
	// $pilih=mysql_select_db("uwika_krs",$conn);
	$pdo->query("USE uwika_krs");

?>
<style type="text/css">
	body{ behavior:url(cssHoverFix.htc);}
	#div a { normal state }
	#div a:hover { alternative state }
</style>
<html>
<head>
<title>Student Home !</title>
<link rel="stylesheet" type="text/css" href="css/reset_main.css">
<link rel="stylesheet" type="text/css" href="css/main.css">
</head>
<body>	
	<header id="main">
		<table id="header">
			<tr>
				<td class="header_logo_small"><a class="header_logo_small" href="#"></a></td>
				<td class="header_announce">
					<marquee style="letter-spacing:1px;marquee-speed:slow;">
						Nilai <strong>UTS</strong> Semester Gasal Periode 2012-2013 sudah keluar *sebagian. 
						Jika anda menemukan Bug / Kritik / Saran, silahkan Laporkan kepada ICT Sesegera mungkin. 
						Terima Kasih.
					</marquee>
				</td>
				<td class="header_user_name"><a class="header_user_name_a" href="#">	RaditYoh Hern Anda </a></td>
				<td class="header_user_photo">
					<a class="header_user_photo_a" href="#">
						<img class="header_user_photo_img" src="https://fbcdn-profile-a.akamaihd.net/hprofile-ak-ash4/275975_1421511934_1108467817_q.jpg">
					</a>
				</td>
			</tr>
		</table>
	</header>
	<table class="board">
		<tr>
			<td class="sidebar">
				<div id="navigation">
					<ul class="top-level">
						<li><a href="#" class="clicked">Home</a></li>
						<li><a href="#">Penawaran KRS</a></li>
						<li><a href="#">KRS Terdaftar</a></li>
						<li><a href="#">Nilai KHS</a></li>
						<li><a href="#">Setting</a></li>
					</ul>
				</div>
			</td>
			<td  class="bigbox">
				<div>
					<div class="banner"></div>
					<table align="center" width="100%">
					  <tr>
						<td>
							<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>
							<br>
							<div align="center">
							<br><br>
							<form name="form1" method="get" action="view.php">
							Lihat daftar mata kuliah yang <b> sedang ditawarkan </b> pada :
							<br>SEMESTER : <select name="sel_smt">

							<?php
								//hanya menampilkan semester dari JURUSANnya itu sendiri, bukan jurusannya orang lain.
								$sql = "SELECT distinct semester FROM penawaran WHERE jurusan = :jurusan ORDER BY semester";
								$stmt = $pdo->prepare($sql);
								$stmt->execute(array(':jurusan' => $reg_jurusan));

								while($row = $stmt->fetch(PDO::FETCH_OBJ)){
									echo "<option>".$row->semester."</option>";
								}
								
							?>
							</select>
							<br>Periode <?php echo $_global_settings['semester']->value; ?> / <?php echo $_global_settings['tahun_ajaran']->value; ?> <br> <!-- semester tahun ajaran ato periode -->
							<?php
								if (date("Y-m-d H:i:s") >= $_global_settings['waktu_krs_mulai']->value && date("Y-m-d H:i:s") <= $_global_settings['waktu_krs_selesai']->value){ // batasan waktu (jam 30 agust 13.00.01 - 14 sept 23.59.59)
									echo "<input type=\"submit\" value=\"Lihat\">";
								}else{
									echo "~ Maaf Tidak Memasuki Masa KRS ~";
								}
							?>
							</form>

							<form name="form2" method="get" action="viewkrs.php">
							Lihat daftar mata kuliah yang <b> sudah didaftarkan </b> pada : 
							<br>Semester <?php echo $_global_settings['semester']->value; ?>		<!-- semesteran -->
							<br>Periode : <?php echo $_global_settings['tahun_ajaran']->value; ?>	<!-- tahun ajaran -->
							<br>
							<input type="submit" value="Lihat">
							</form>
							</div>
							<BR>
							<?php 
								include("footer.php");
							?>
						</td>
					  </tr>
					  <tr>
						<td bgcolor="7e96dc"><div align="center">
						</div></td>
					  </tr>
					</table>
				</div>
			</td>
		</tr>
	</table>
	<footer id="main">
	  <div><a href="http://www.widyakartika.ac.id/perpustakaan">Perpustakaan Online</a> | <a href="http://krs.widyakartika.ac.id/">KRS Online</a></div>
	  <div>Copyright &copy; 2012. <a href="http://www.widyakartika.ac.id">Universitas Widya Kartika</a> & <a href="#">Labkom ICT</a> - All rights reserved</div>
		<?php
			$_finish_timer = get_microtime();
			echo 'Page generated in '.round(($_finish_timer - $_start_timer), 4).' seconds.';
		?>
	</footer>
</body>
